package org.dromara.knowledgebase.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.*;
import lombok.Data;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.knowledgebase.domain.Knowledge;

@Data
@AutoMapper(target = Knowledge.class, reverseConvertGenerate = false)
public class KnowledgeBo {


    /**
     * 文档ID[雪花]
     */
    @NotNull(message = "文档ID不能为空", groups = {EditGroup.class})
    @Null(message = "文档ID必须为空", groups = {AddGroup.class})
    private Long documentId;

    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空", groups = {AddGroup.class, EditGroup.class})
    private String title;

    /**
     * 小标题
     */
    private String subTitle;

    /**
     * 来源
     */
    private String source;

    /**
     * 作者
     */
    private String author;

    /**
     * 种类
     */
    private String[] category;

    /**
     * 类型
     */
    private String type;

    /**
     * 链接
     */
    private String url;

    /**
     * 标签[人工]
     */
    private String[] tags;

    /**
     * 0 HTML, 1 MARKDOWN
     */
    @Min(value = 0, message = "内容格式类型只能是0/1", groups = {AddGroup.class, EditGroup.class})
    @Max(value = 1, message = "内容格式类型只能是0/1", groups = {AddGroup.class, EditGroup.class})
    private Integer formattedType = 0;

    /**
     * 格式化的本内容
     */
    private String formattedContent;
}
